<template>
	<el-form  :model="planform" label-width="80px">
	
		<el-form-item label="病人号">
			<el-input v-model="planform.patientId"></el-input>
		</el-form-item>
		<el-form-item label="病因">
			<el-input v-model="planform.diseaseCause"></el-input>
		</el-form-item>
		<el-form-item label="治疗处方">
			<el-input v-model="planform.prescription"></el-input>
		</el-form-item>
		<el-form-item label="主治医生">
			<el-input v-model="planform.physician"></el-input>
		</el-form-item>
		<el-form-item label="治疗医师">
			<el-input v-model="planform.therapist"></el-input>
		</el-form-item>
		<el-form-item label="开始时间">
			 <el-date-picker
			      v-model="planform.starttime"
			      type="datetime"
				  value-format="yyyy-MM-dd HH:mm:ss"
			      placeholder="选择日期">
			    </el-date-picker>
		</el-form-item>
		<el-form-item label="治疗周期">
			<el-input v-model="planform.recoveryCycle"></el-input>
		</el-form-item>
		<el-button type="primary" @click="doPlanAdd">提交</el-button>
	</el-form>
</template>

<script>
	
	export default{
		name:'PlanAdd',
		props:[
			'dialogVisible'
		],
		data(){
			return {
				planform:{
					patientId:'',
					diseaseCause:'',
					prescription:'',
					physician:'',
					therapist:'',
					starttime:'',
					recoveryCycle:''
				}
			}
		},
		methods:{
			doPlanAdd(){
				this.getRequest("/recovery/insert",this.planform).then(resp=>{
					
					if(resp){
						this.$emit("update:dialogVisible",false);
						this.$emit("add")
					}else{
						this.$message.error({message:'添加失败'});
					}
				})
			}
		}
	}
</script>

<style>
</style>
